﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MedRegService.Utils
{
    public class FlatLPU
    {
        public Guid ID { get; set; }

        public string Name { get; set; }

        public FlatLPU() {}

        public static List<FlatLPU> GetFlatLPUList ()
        {
            var mdb = new MedregDBDataContext();

            var result = new List<FlatLPU>();

            foreach (var lpu in mdb.LPU)
            {
                var flatLPU = new FlatLPU();

                flatLPU.Name = lpu.Name;
                flatLPU.ID = lpu.RealID;

                result.Add(flatLPU);
            }

            return result;
        }
    }
}
